//
//  QueryNumberController.m
//  shike
//
//  Created by RegentSoft on 2017/4/25.
//  Copyright © 2017年 RegentSoft. All rights reserved.
//

#import "QueryNumberController.h"
#import "QueryDetailController.h"
@interface QueryNumberController ()

@end

@implementation QueryNumberController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"查询成绩";
    self.view.backgroundColor = [UIColor colorWithHexString:@"#F0F0F5"];
    //导航栏的标题颜色字体
    self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
    self.navigationController.navigationBar.tintColor = [UIColor colorWithHexString:@"#999999"];
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName :[UIColor colorWithHexString:@"#323232"],NSFontAttributeName :[UIFont systemFontOfSize:16.0]}];

    [self creatView];
}
-(void)creatView{
    UIView * bgView =[[UIView alloc] initWithFrame:CGRectMake(0, 0,DeviceWidth, DeviceHeight)];
    bgView.backgroundColor = [UIColor colorWithHexString:@"#000000"];
    bgView.alpha= 0.5;
    [self.view addSubview:bgView];
    UIButton * beginBtn =[[UIButton alloc] initWithFrame:CGRectMake(15, DeviceHeight-55, DeviceWidth-30, 40)];
    beginBtn.backgroundColor = [UIColor whiteColor];
    beginBtn.layer.cornerRadius = 8.0;
    [beginBtn setTitle:@"查看详情" forState:UIControlStateNormal];
    [beginBtn setTitleColor:[UIColor colorWithHexString:@"#323232"] forState:UIControlStateNormal];
    beginBtn.titleLabel.font = [UIFont systemFontOfSize:16.0];
    [beginBtn addTarget:self action:@selector(beginBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [bgView addSubview:beginBtn];
    
    UILabel * titleLabel =[[UILabel alloc] init];
    titleLabel.textColor = [UIColor colorWithHexString:@"#ffffff"];
    titleLabel.text = @"销售技巧培训考核";
    titleLabel.font = [UIFont systemFontOfSize:20.0];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    [bgView addSubview:titleLabel];
    
    UILabel * timeLabel =[[UILabel alloc] init];
    timeLabel.textColor = [UIColor colorWithHexString:@"#ebebeb"];
    timeLabel.text = @"2014-12-12 ~ 2017-12-12";
    timeLabel.font = [UIFont systemFontOfSize:12.0];
    timeLabel.textAlignment = NSTextAlignmentCenter;
    [bgView addSubview:timeLabel];
    
    UIImageView * imageView =[[UIImageView alloc] init];
    imageView.image = [UIImage imageNamed:@"query1"];
    [bgView addSubview:imageView];
    
    UILabel * allTimeLabel =[[UILabel alloc] init];
    allTimeLabel.textColor = [UIColor colorWithHexString:@"#14ea5f"];
    allTimeLabel.text = @"80";
    allTimeLabel.font = [UIFont systemFontOfSize:24.0];
    allTimeLabel.textAlignment = NSTextAlignmentCenter;
    [bgView addSubview:allTimeLabel];
    
    UILabel * allNumberLabel1 =[[UILabel alloc] init];
    allNumberLabel1.textColor = [UIColor colorWithHexString:@"#ffffff"];
    allNumberLabel1.text = @"80";
    allNumberLabel1.font = [UIFont systemFontOfSize:20.0];
    allNumberLabel1.textAlignment = NSTextAlignmentCenter;
    [imageView addSubview:allNumberLabel1];
    
    UILabel * Label1 =[[UILabel alloc] init];
    Label1.textColor = [UIColor colorWithHexString:@"#ebebeb"];
    Label1.text = @"总分";
    Label1.font = [UIFont systemFontOfSize:12.0];
    Label1.textAlignment = NSTextAlignmentCenter;
    [imageView addSubview:Label1];
    
    UILabel * numberLabel1 =[[UILabel alloc] init];
    numberLabel1.textColor = [UIColor colorWithHexString:@"#ffffff"];
    numberLabel1.text = @"50";
    numberLabel1.font = [UIFont systemFontOfSize:20.0];
    numberLabel1.textAlignment = NSTextAlignmentCenter;
    [imageView addSubview:numberLabel1];
    
    UILabel * Label2 =[[UILabel alloc] init];
    Label2.textColor = [UIColor colorWithHexString:@"#ebebeb"];
    Label2.text = @"通过分数";
    Label2.font = [UIFont systemFontOfSize:12.0];
    Label2.textAlignment = NSTextAlignmentCenter;
    [imageView addSubview:Label2];
    int deviceWidth = DeviceWidth;
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bgView.mas_left).offset(40);
        make.right.equalTo(bgView.mas_right).offset(-40);
        make.top.equalTo(bgView.mas_top).offset(110);
        make.height.mas_equalTo(25);
        
    }];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bgView.mas_left).offset(85);
        make.right.equalTo(bgView.mas_right).offset(-85);
        make.top.equalTo(titleLabel.mas_bottom).offset(10);
        make.height.mas_equalTo(15);
    }];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(bgView.mas_centerY);
        make.left.equalTo(bgView.mas_left).offset(15);
        make.right.equalTo(bgView.mas_right).offset(-15);
        if (deviceWidth ==320) {
            make.height.mas_equalTo(95);
        }else if(deviceWidth ==375){
            make.height.mas_equalTo(110);
        }else{
            make.height.mas_equalTo(120);
        }
    }];
    [allTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bgView.mas_left).offset((DeviceWidth-55)/2);
        make.top.equalTo(imageView.mas_top).offset(35);
        make.height.mas_equalTo(40);
        make.width.mas_equalTo(55);
    }];
    [allNumberLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(imageView.mas_left).offset(30);
        make.top.equalTo(imageView.mas_top).offset(31);
        make.height.mas_equalTo(24);
        make.width.mas_equalTo(60);
    }];
    [Label1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(allNumberLabel1.mas_left).offset(0);
        make.top.equalTo(allNumberLabel1.mas_bottom).offset(0);
        make.height.mas_equalTo(24);
        make.width.mas_equalTo(60);
        
    }];
    [numberLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(imageView.mas_right).offset(-30);
        make.top.equalTo(imageView.mas_top).offset(31);
        make.height.mas_equalTo(24);
        make.width.mas_equalTo(60);
        
    }];
    [Label2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(numberLabel1.mas_left).offset(-10);
        make.top.equalTo(numberLabel1.mas_bottom).offset(0);
        make.height.mas_equalTo(24);
        make.width.mas_equalTo(80);
    }];
    
}
-(void)beginBtnClick{
    QueryDetailController * detailstView =[[QueryDetailController alloc] init];
    detailstView.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:detailstView animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
